import request from '@/utils/request';
import {Response} from '@/type/ResponseType';

enum Enum {
  deletePatinetAPI = '/user/patient/auth/remove',
  update = '/user/patient/auth/update',
  save = '/user/patient/auth/save'
}

/**
 * @description 删除就诊人的接口
 * */

export const deletePatinetAPI = (patinetId: number) => request.delete<boolean,Response<boolean>>(`${Enum.deletePatinetAPI}/${patinetId}`);


/**
 * @description 添加或者编辑就诊人的接口
 * */
export const addOrUpdatePatinetAPI = (data: any) => {
  if (data.id) {
    return request.put<boolean,Response<boolean>>(Enum.update, data);
  } else {
    return request.post<boolean,Response<boolean>>(Enum.save, data);
  }
};
